<?php

class SkolaPeer extends BaseSkolaPeer
{
  public static $tip = array('osnovna' => 1, 'područna' => 2, 'gimnazija' => 3, 'srednja' => 4, 'područna_velika' => 5);
  public static $tip_string = array(1 => 'OŠ', 2 => 'PŠ' , 3 => 'Gimnazija' , 4 => 'Srednja', 5 => 'PŠ');
  public static $tip_obrasca = array('ucenici' => 1, 'clanarina' => 2, 'prazno' => 3);

  public static function getTips()
  {
    return array_flip(self::$tip);
  }

  public static function getObrazacTips()
  {
    return array_flip(self::$tip_obrasca);
  }

  public static function getSkolaList()
  {
     $skola_dbs = DbFinder::from('Skola')->select(array('Id', 'Ime', 'Mesto'))->orderBy('Ime')->find();
     $skolas = array();
     foreach($skola_dbs as $skola_db)
       $skolas[$skola_db['Id']] = $skola_db['Ime'].' - '.$skola_db['Mesto'];

     return $skolas;
  }

  public static function getSkolaIdList($skola_ids)
  {
     $skola_dbs = DbFinder::from('Skola')->select(array('Id', 'Ime', 'Mesto'))->where('Id', 'in', $skola_ids)->orderBy('Ime')->find();
     $skolas = array();
     foreach($skola_dbs as $skola_db)
       $skolas[$skola_db['Id']] = $skola_db['Ime'].' - '.$skola_db['Mesto'];

     return $skolas;
  }

}
